package p8;

/**
 * @author krystal
 * @date 2022/11/12 15:03
 */
class Person implements Cloneable{
    public int age=10;

    public Person() {
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                '}';
    }
}

public class Demo5 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person=new Person();
        Person person1=(Person) person.clone();
    }
}
